/**
 * @file Rune.h
 * @author enemy1205 (enemy1205@qq.com)
 * @brief 能量机关头文件
 * @date 2021-08-16
 *
 */
#pragma once

#include "Parameter.h"
#include "Math.h"
#include "Features.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

using cv::Vec4i;
using cv::Point;
using cv::Mat;
using std::shared_ptr;
extern const RuneParam R_param;

class Rune_Armor : public Features {
public:
    //显示神符装甲板构造函数
    explicit Rune_Armor(cv::RotatedRect &);

    void updateRestInfo() override {};

    Features_ptr getSon1_Features() override {return nullptr;};

    Features_ptr getSon2_Features() override {return nullptr;};
};

using R_Armor_ptr = std::shared_ptr<Rune_Armor>;

class Rune : public Features {
public:
    //神符构造函数
    Rune(const vector<vector<Point>> &, const vector<Vec4i> &);

    //返回神符装甲板指针
    R_Armor_ptr &Rune_armor() { return this->R_Armor; }

    //计算神符装甲板角点
    void calculatePoints();

    // 计算神符旋转角度
    void calculateRotatedAngle();

//    // 获取神符旋转半径
//    inline float getRadius() { return this->rotate_radius; }

    //过滤能量机关中心
    bool Filter_center(cv::RotatedRect &, const vector<Point> &);

    void updateRestInfo() override;

    Features_ptr getSon1_Features() override { return this->R_Armor; };

    Features_ptr getSon2_Features() override { return this->R_Armor; };

private:
    R_Armor_ptr R_Armor;    //神符装甲板指针
//    float rotate_radius;    // 旋转半径
};

using Rune_ptr = std::shared_ptr<Rune>;
